/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package Entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Gautch
 */
@Entity
@Table(name = "contrathabitat")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Contrathabitat.findAll", query = "SELECT c FROM Contrathabitat c"),
    @NamedQuery(name = "Contrathabitat.findByNumcontrathabitat", query = "SELECT c FROM Contrathabitat c WHERE c.numcontrathabitat = :numcontrathabitat"),
    @NamedQuery(name = "Contrathabitat.findByAdresse", query = "SELECT c FROM Contrathabitat c WHERE c.adresse = :adresse"),
    @NamedQuery(name = "Contrathabitat.findByCodepostal", query = "SELECT c FROM Contrathabitat c WHERE c.codepostal = :codepostal"),
    @NamedQuery(name = "Contrathabitat.findBySurface", query = "SELECT c FROM Contrathabitat c WHERE c.surface = :surface"),
    @NamedQuery(name = "Contrathabitat.findByCategoriehabitat", query = "SELECT c FROM Contrathabitat c WHERE c.categoriehabitat = :categoriehabitat"),
    @NamedQuery(name = "Contrathabitat.findByPrixcontrathabitat", query = "SELECT c FROM Contrathabitat c WHERE c.prixcontrathabitat = :prixcontrathabitat"),
    @NamedQuery(name = "Contrathabitat.findByFranchise", query = "SELECT c FROM Contrathabitat c WHERE c.franchise = :franchise"),
    @NamedQuery(name = "Contrathabitat.findByStatut", query = "SELECT c FROM Contrathabitat c WHERE c.statut = :statut"),
    @NamedQuery(name = "Contrathabitat.findByNumeroclient", query = "SELECT c FROM Contrathabitat c WHERE c.numeroclient = :numeroclient"),
    @NamedQuery(name = "Contrathabitat.findByIncendie", query = "SELECT c FROM Contrathabitat c WHERE c.incendie = :incendie"),
    @NamedQuery(name = "Contrathabitat.findByVol", query = "SELECT c FROM Contrathabitat c WHERE c.vol = :vol"),
    @NamedQuery(name = "Contrathabitat.findByDegatEau", query = "SELECT c FROM Contrathabitat c WHERE c.degatEau = :degatEau"),
    @NamedQuery(name = "Contrathabitat.findByBienPrecieux", query = "SELECT c FROM Contrathabitat c WHERE c.bienPrecieux = :bienPrecieux")})
public class Contrathabitat implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "numcontrathabitat")
    private Integer numcontrathabitat;
    @Size(max = 100)
    @Column(name = "adresse")
    private String adresse;
    @Size(max = 10)
    @Column(name = "codepostal")
    private String codepostal;
    @Column(name = "surface")
    private Integer surface;
    @Column(name = "categoriehabitat")
    private Integer categoriehabitat;
    @Column(name = "prixcontrathabitat")
    private Integer prixcontrathabitat;
    @Column(name = "franchise")
    private Integer franchise;
    @Size(max = 30)
    @Column(name = "statut")
    private String statut;
    @Basic(optional = false)
    @NotNull
    @Column(name = "numeroclient")
    private int numeroclient;
    @Column(name = "incendie")
    private Boolean incendie;
    @Column(name = "vol")
    private Boolean vol;
    @Column(name = "degat_eau")
    private Boolean degatEau;
    @Column(name = "bien_precieux")
    private Boolean bienPrecieux;

    public Contrathabitat() {
    }

    public Contrathabitat(Integer numcontrathabitat) {
        this.numcontrathabitat = numcontrathabitat;
    }

    public Contrathabitat(Integer numcontrathabitat, int numeroclient) {
        this.numcontrathabitat = numcontrathabitat;
        this.numeroclient = numeroclient;
    }
    
    public Contrathabitat(int surface, boolean incendie, boolean vol,
            boolean degatEau, boolean bienPrecieux, String adresse, String code, int categorie, 
            int prix, int franchise, int numeroClient){
        this.adresse = adresse;
        this.bienPrecieux = bienPrecieux;
        this.categoriehabitat = categorie;
        this.codepostal = code;
        this.degatEau = degatEau;
        this.franchise = franchise;
        this.incendie = incendie;
        this.numeroclient = numeroClient;
        this.prixcontrathabitat = prix;
        this.statut = "aValiderHab";
        this.surface = surface;
        this.vol = vol;
    }

    public Integer getNumcontrathabitat() {
        return numcontrathabitat;
    }

    public void setNumcontrathabitat(Integer numcontrathabitat) {
        this.numcontrathabitat = numcontrathabitat;
    }

    public String getAdresse() {
        return adresse;
    }

    public void setAdresse(String adresse) {
        this.adresse = adresse;
    }

    public String getCodepostal() {
        return codepostal;
    }

    public void setCodepostal(String codepostal) {
        this.codepostal = codepostal;
    }

    public Integer getSurface() {
        return surface;
    }

    public void setSurface(Integer surface) {
        this.surface = surface;
    }

    public Integer getCategoriehabitat() {
        return categoriehabitat;
    }

    public void setCategoriehabitat(Integer categoriehabitat) {
        this.categoriehabitat = categoriehabitat;
    }

    public Integer getPrixcontrathabitat() {
        return prixcontrathabitat;
    }

    public void setPrixcontrathabitat(Integer prixcontrathabitat) {
        this.prixcontrathabitat = prixcontrathabitat;
    }

    public Integer getFranchise() {
        return franchise;
    }

    public void setFranchise(Integer franchise) {
        this.franchise = franchise;
    }

    public String getStatut() {
        return statut;
    }

    public void setStatut(String statut) {
        this.statut = statut;
    }

    public int getNumeroclient() {
        return numeroclient;
    }

    public void setNumeroclient(int numeroclient) {
        this.numeroclient = numeroclient;
    }

    public Boolean getIncendie() {
        return incendie;
    }

    public void setIncendie(Boolean incendie) {
        this.incendie = incendie;
    }

    public Boolean getVol() {
        return vol;
    }

    public void setVol(Boolean vol) {
        this.vol = vol;
    }

    public Boolean getDegatEau() {
        return degatEau;
    }

    public void setDegatEau(Boolean degatEau) {
        this.degatEau = degatEau;
    }

    public Boolean getBienPrecieux() {
        return bienPrecieux;
    }

    public void setBienPrecieux(Boolean bienPrecieux) {
        this.bienPrecieux = bienPrecieux;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (numcontrathabitat != null ? numcontrathabitat.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Contrathabitat)) {
            return false;
        }
        Contrathabitat other = (Contrathabitat) object;
        if ((this.numcontrathabitat == null && other.numcontrathabitat != null) || (this.numcontrathabitat != null && !this.numcontrathabitat.equals(other.numcontrathabitat))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entity.Contrathabitat[ numcontrathabitat=" + numcontrathabitat + " ]";
    }
    
}
